package com.sunny.ihealth.entity.bmob;

import android.text.TextUtils;

import cn.bmob.v3.BmobUser;
import cn.bmob.v3.datatype.BmobFile;

/**
 * 用户信息类
 * Created by Sunny  An on 2016/5/13.
 */
public class UserInfo extends BmobUser {

    public static final boolean GENDER_MALE = true;
    public static final boolean GENDER_FEMALE = false;

    private String nickname;
    private String signature;
    /**
     * 男性为 true   女性为 false
     */
    private Boolean gender;
    private BmobFile headFile;
    private Integer friendNumber;
    private Integer fansNumber;
    private Integer id;


    //下列数据不在数据库存储
    private Integer isFriend;
    private Integer postsNumber;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    /**
     * @return 男性为 true   女性为 false
     */
    public Boolean getGender() {
        return gender;
    }

    /**
     * @param gender 男性为 true   女性为 false
     */
    public void setGender(Boolean gender) {
        this.gender = gender;
    }

    public BmobFile getHeadFile() {
        return headFile;
    }

    public void setHeadFile(BmobFile headFile) {
        this.headFile = headFile;
    }


    public Integer getFriendNumber() {
        return friendNumber;
    }

    public void setFriendNumber(Integer friendNumber) {
        this.friendNumber = friendNumber;
    }

    public Integer getFansNumber() {
        return fansNumber;
    }

    public void setFansNumber(Integer fansNumber) {
        this.fansNumber = fansNumber;
    }

    /**
     * 是否有头像
     */
    public boolean hasHead() {
        return headFile != null && !TextUtils.isEmpty(headFile.getUrl());
    }

    public Integer getIsFriend() {
        return isFriend;
    }

    public void setIsFriend(Integer isFriend) {
        this.isFriend = isFriend;
    }

    //是否是好友
    public int isFriend() {
        return isFriend == null ? State.STATE_CANCEL_ADD : isFriend;
    }

    public Integer getPostsNumber() {
        return postsNumber;
    }

    public void setPostsNumber(Integer postsNumber) {
        this.postsNumber = postsNumber;
    }
}
